package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.Seat;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 作者：Xx凯丶
 * 时间：2022/4/22 9:39
 */
@Mapper
public interface SeatMapper extends BaseMapper<Seat> {
    @Select("SELECT  seat_id,hall_id,cinema_id,`row`,`column`,`status`  \n" +
            "FROM seat     \n" +
            "WHERE (cinema_id = #{cinemaId} AND hall_id = #{hallId})")
    public List<Seat> selectSeatByCinemaIdAndHallId(@Param("cinemaId") Integer cinemaId,
                                                    @Param("hallId") Integer hallId);
    @Select("SELECT  DISTINCT `row` \n" +
            "FROM seat\n" +
            "WHERE cinema_id=#{cinemaId} and hall_id =#{hallId};")
    public List<Integer> selectRowByCinemaIdAndHallId(@Param("cinemaId") Integer cinemaId,
                                                      @Param("hallId") Integer hallId);
}
